/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JProductStorePanel.java
 *
 * Created on 2010-4-8, 8:50:29
 */

package cn.ekuma.epos.qkorder.link;

import cn.ekuma.epos.datalogic.I_DataLogicSales;

import com.openbravo.bean.Product;
import com.openbravo.bean.viewbean.ProductStoreView;
import com.openbravo.data.basic.BasicException;
import com.openbravo.data.gui.MessageInf;
import com.openbravo.pos.panels.link.AbstractProductSelectTablePanel;
import com.openbravo.pos.panels.link.model.ProductStoreVTableModel;

/**
 *
 * @author Administrator
 */
@SuppressWarnings("serial")
public class JProductIncludeBomStorePanel extends AbstractProductSelectTablePanel<ProductStoreView>{

    /** Creates new form JProductStorePanel */
    public JProductIncludeBomStorePanel(I_DataLogicSales dlSales) {
       super(dlSales,new ProductStoreVTableModel());
    }

	@Override
	public void baseBeanChanged(Product o) {
		try {
            tableModel.resert(dlSales.getProductIncludeBomStoreQBF(createValue()));
        } catch (BasicException ex) {
        	new MessageInf(ex).show(this);
            tableModel.resert(null);
        }
		
	}

	@Override
	public String getProductId(ProductStoreView obj) {
		return obj.getM_ID();
	}


}
